
class Cat {
    private int hp = 80;
    public Cat() {

    }
    public Cat(int hp) {
        this.hp = hp;
    }
    public int getHp() {
        return this.hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public void attack(Dog g) {
        int ac = (int)Math.random();
        g.setHp(g.getHp() - ac);
    }
}

class Dog {
    private int hp = 90;
    public Dog() {

    }
    public Dog(int hp) {
        this.hp = hp;
    }
    public int getHp() {
        return this.hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public void attack(Cat c) {
        int ac = (int)Math.random();
        c.setHp(c.getHp() - ac);
    }
}

public class TestDemo {

}
